//
//  ObjectMapper+LSF.swift
//  Exam-iOS
//
//  Created by 李胜锋 on 2018/3/6.
//  Copyright © 2018年 李胜锋. All rights reserved.
//

import Foundation
import ObjectMapper


extension BaseMappable {
    static func array(_ data:Any?) -> [Self]?  {
        
        var objects = [Self]()
        guard let dataArray = data as? [Any] else { return nil }
        for object in dataArray {
            if let data = object as? [String: Any] {
                let object = Mapper<Self>().map(JSON: data)!
                objects.append(object)
            }
        }
        return objects
    }
}
